home *** CD-ROM | disk | FTP | other *** search
- PROCEDURE ErrLog
- *-----------------------------------------------------------------------
- *-- Programmer..: Peter Ripaldi (CIS: 70711,3420) (1-508-683-4987)
- *-- Date........: 05/24/1993
- *-- Notes.......: Program to produce an error log on disk that is about
- *-- 12k long. The idea is to provide as much information
- *-- as possible about the system at the time of the error.
- *-- On error you can print the screen to printer and/or
- *-- disk if you uncomment the section(s). The error log on
- *-- disk is called ERROR.LOG, each error session will
- *-- add to the bottom of the previous error.
- *-- Any suggestion to adssd, or if it helps
- *-- let me know. Happy Erroring ?
- *-- Written for.: dBASE IV 1.5
- *-- Rev. History: 08/23/1992 -- Original
- *-- 04/09/1992 1.0 - none- format from E_LOG.PRG
- *-- Ideas from E_LOG.PRG author unknown
- *-- ERR_TRAP.PRG author BILLG (BORBBS)
- *-- SPY_CAM author dbf magazine
- *-- 08/23/1992 1.5 Added functions for ver 1.5
- *-- Save to screen before error msg on screen
- *-- Append print screen to end of ERROR.LOG
- *-- file. Send network msg, idea from
- *-- Bob(IVYBURT)
- *-- 11/13/1992 -- modified seriously by Ken Mayer, allowing
- *-- programmer calls to PRINTSCR and SCREEN,
- *-- as well as network, by passing parms to
- *-- the routine. Cleaned up the programming
- *-- a lot. Removed the need for as many
- *-- memvars.
- *-- 05/24/1993 -- Updated by Peter Stevens (HMRS)
- *-- (CIS 100114,301)
- *-- Resolved small problem with MESSAGE()
- *-- Non-RunTime commands are *rd out
- *-- 11/01/1993 -- Uppdated by Ken Mayer for 3-D version
- *-- of SURROUND() routine.
- *-- Calls.......: PRINTSCR.BIN Prints screen to printer if parameter is
- *-- set
- *-- SCREEN.BIN Prints screen to disk if parameter is
- *-- set
- *-- SURROUND() Function below
- *-- CENTER Procedure below
- *-- Called by...: Any
- *-- Usage.......: on error do ErrorLog with error(),message(),lineno(),;
- *-- program(),alias(),memory();
- *-- [,<lPrntScrn>[,<lScrn2Disk>;
- *-- [,<cNetId>]]]
- *-- Example.....: on error do errorlog with error(),message(),lineno(),;
- *-- program(),alias(),memory(),.t.,;
- *-- .t.,"MAYER"
- *-- Returns.....: None
- *-- Parameters..: error() = dBASE Function
- *-- message() = dBASE Function
- *-- lineno() = dBASE Function
- *-- program() = dBASE Function
- *-- alias() = dBASE Function
- *-- memory() = dBASE Function
- *-- lPrntScrn = logical -- print the screen?
- *-- lScrn2Disk = logical -- print the screen to disk?
- *-- cNetId = Network ID for user on a NOVELL NETWORK
- *-- to send a Network message to letting them
- *-- know about this error.
- *-----------------------------------------------------------------------
- *-- Try to bring in as much of system before loading anything else
- PARAMETER nError,cErrTxt,nLineNo,cProgram,cAlias,nMemory,lPrntScrn,;
- lScrn2Disk,cNetId
-
- *-- talk off so answers to IIF() dont go in ERROR.LOG file
- cTalk = set("TALK")
- set talk off
-
- *-- deal with optional parameters
- m->nParms = pCount() && how many parameters were passed?
- if m->nParms < 9 && no Net Id
- m->cNetId = ""
- endif
- if m->nParms < 8 && no lScrn2Disk parm
- m->lScrn2Disk = .f.
- endif
- if m->nParms < 7 && no Print Screen parm
- m->lPrntScrn = .f.
- endif
-
- *-- Get copy of screen so we can restore it after were done
- save screen to sError
- activate screen
-
- *-- set up disk file ERROR.LOG
- set alternate to
-
- *-- Let user know SOMETHING'S happening
- x=surround(12,"rg+/r","An Error Has Occured -- Writing Log")
- x=surround(18,"rg+/rg",""+trim(cErrTxt)+" ")
- *-- Pause a while so user can see what the error is
- i = inkey(2)
-
- *-- If already there add to it, in case of more errors next time
- *-- runs prg
- if file("ERROR.LOG")
- set alternate to error.log additive
- else
- *-- If not there make one
- set alternate to error.log
- endif && file("ERROR.LOG")
-
- *-- Turn on ERROR.LOG file
- set alternate on
-
- *-- Turn screen off
- set console off
-
- *-- set date to 19xx format
- set century on
-
- *-- Begin error logging information to disk
- *
- * Set up heading
- ? "==================================================================="
- ? "===== Begin Errors Found ====="
- ? "====="
- ?? SPACE(6)+CDOW(DATE())+SPACE(10)+MDY(DATE())+SPACE(9)+(TIME())
- ?? "====="
- ? "==================================================================="
- ?
- ? " Error / Program Information"
- ? "------------------------------"
- ? " Error # : " + LTRIM(STR(m->nError)) +" "+trim(m->cErrTxt)
- ? " In Program : " + m->cProgram
- ? " On Line # : " + LTRIM(STR(m->nLineNo))
- ? " Catalog Name : " + LTRIM(CATALOG())
- ?
- ?
-
- ? " System Information"
- ? "------------------------------"
- ? " Memory : " + LTRIM(STR(m->nMemory))
- ? " Diskspace : " + LTRIM(STR(DISKSPACE()))
- ? " Path : " + GETENV("path")
- ? " Prompt : " + GETENV("prompt")
- ? " ComSpec : " + GETENV("comspec")
- ? " Operating Sys : " + LTRIM(OS())
- ? " Dbase Version : " + LTRIM(VERSION(0))
- ? " Dbase Path : " + LTRIM(HOME())
- ? " Compile Error : " + LTRIM(STR(CERROR()))
- ? " Color system : " + iif(iscolor(),"Yes","No")
- ?
- ?
-
- ? " Database File Information "
- ? "------------------------------"
- ? " DBF File : " + DBF()
- ? " Alias Name : " + m->cAlias
- ? " Work area : " + LTRIM(STR(SELECT()))
- ? " Order : " + ORDER()
- ? " Record # : " + LTRIM(STR(RECNO()))
- ? " Field count : " + LTRIM(STR(FLDCOUNT()))
- ? " Tag name : " + LTRIM(TAG())
- ? " Tag count : " + LTRIM(STR(TAGCOUNT()))
- ? " Tag number : " + LTRIM(STR(TAGNO()))
- ? " MDX file : " + LTRIM(MDX())
- ? " NDX file : " + LTRIM(NDX())
- ? " Descending index: " + iif(descending(),"Yes","No")
- ?
- ? " For condition of mdx tag : " + LTRIM(FOR())
- ? " Expression of mdx/ndx tag : " + LTRIM(KEY())
- ? " Unique Index : " + iif(unique(),"Yes","No")
- ? " Deleted : " + iif(deleted(),"Yes","No")
- ? " Record Count : " + LTRIM(STR(RECCOUNT()))
- ?
- *-- record size may not be right add 35 for header if wanted
- ? " Record Size : " + LTRIM(STR(RECSIZE()))
- ? " Last Update : " + DTOC(LUPDATE())
- ? " Last Seek Found : " + iif(found(),"Yes","No")
- ? " End Of File : " + iif(eof(),"Yes","No")
- ? " Begin Of File : " + iif(bof(),"Yes","No")
- ?
- ?
-
- ? " Program Information "
- ? "------------------------------"
- ? " Number of parameters called : " + LTRIM(STR(PCOUNT()))
- ?
- ?
-
- ? " File / User / Network Information"
- ? "------------------------------"
- ? " On Network : " + iif(network(),"Yes","No")
- ? " DBF in state of change : " + iif(ismarked(),"Yes","No")
- ? " User Access Level : " + LTRIM(STR(ACCESS()))
- ? " Log in User Name : " + USER()
- ? " Name of current User : " + ID()
- ? " Changed by others : " + iif(change(),"Yes","No")
- ? " Completed Transaction : " + iif(completed(),"Yes","No")
- ? " Rollback Successful : " + iif(rollback(),"Yes","No")
- ? " Record Lock : " + iif(rlock(),"Yes","No")
- ? " File Lock : " + iif(flock(),"Yes","No")
- ?
- ?
- ? " List of Users "
- ? "--------------------------------"
- list users
- ?
- ?
- ? " Screen Information "
- ? "------------------------------"
- ? " Window : " + WINDOW()
- ? " Pad : " + PAD()
- ? " Popup : " + POPUP()
- ? " Bar # : " + LTRIM(STR(BAR()))
- ? " Prompt : " + PROMPT()
- ? " Menu : " + MENU()
- ? " Cursor Row : " + LTRIM(STR(ROW()))
- ? " Cursor Column : " + LTRIM(STR(COL()))
- ?
- ?
-
- ? " Key Stroke Information "
- ? "------------------------------"
- ? " Varread : " + VARREAD()
- ? " Inkey : " + LTRIM(STR(INKEY()))
- ? " Lastkey : " + LTRIM(STR(LASTKEY()))
- ? " Readkey : " + LTRIM(STR(READKEY()))
- ?
-
- ? " Printer Information "
- ? "------------------------------"
- ? " Print Status : " + iif(printstatus(),"Yes","No")
- ? " Print Column : " + LTRIM(STR(PCOL()))
- ? " Print Row : " + LTRIM(STR(PROW()))
- ?
- ?
-
- * List Status, Memory, History .....
- ? " Status Listing "
- ? "----------------------------------------------"
- ?
- ?
- list status
-
- ? " Memory Listing "
- ? "----------------------------------------------"
- ?
- ?
- list memory
- ?
- ?
-
- * ? " History Listing "
- * ? "------------------------------------------------"
- * list history
- * ?
- * ?
- * End of errors for this time
- ? "==================================================================="
- ? "===== End of Errors Found ====="
- ? "====="
- ?? space(6)+cdow(date())+space(10)+mdy(date())+space(9)+(time())
- ?? "====="
- ? "==================================================================="
- * spaces to seperate error log for next time error happens
- ?
- ?
- ?
- ?
- *-- All done with saving file close up error file
- set alternate off
- set alternate to
- set console on
- set century off
-
- *--------------------------------------------------------------------
- *-- optional stuff here
- *--------------------------------------------------------------------
- restore screen from sError && remove message to user ...
- if m->lPrntScrn
- *-- Print Screen First, uses printscr.bin
- load printscr
- call printscr
- release module printscr
- endif
-
- *--------------------------------------------------------------------
- *-- Print screen to disk?
- *--------------------------------------------------------------------
- * Print screen to disk file called Erscreen.txt, uses screen.bin
- * The "a" option will append to text file
- if m->lScrn2Disk
- load screen
- call screen with "a", "Erscreen.txt"
- release module screen
- eject && form feed to clear out printer ...
-
- *- Add screen to end of ERROR.LOG file
- set alternate to error.log additive
-
- *-- Turn screen off
- set console off
-
- *-- turn on ERROR.LOG file for heading
- set alternate on
- ? "Screen Dump of above error"
- ? "-----------------------------------------------"
- ?
- *-- All done with heading close up ERROR.LOG file
- set alternate off
- set alternate to
-
- *-- Now add screen to end of ERROR.LOG file
- load screen
- call screen with "a", "ERROR.LOG"
- release module screen
- *-- all done
- set console on
- endif && lScrn2File
-
- *---------------------------------------------------------------------
- *-- After all that, let's let the user know what happened
- *---------------------------------------------------------------------
- * For real fun use one of KenMayer's "Death March" Songs (MISC.PRG)
- * Alert user for heart attack, Give a tone
- set bell to 500,5
- ?? chr(7)
- set bell to 400,4
- ?? chr(7)
- *set bell to 500,5
- *?? chr(7)
- *set bell to 400,5
- *?? chr(7)
- *set bell to 500,5
- *?? chr(7)
- set bell to
-
- *-- Give user message, on error window
- define window wError from 0,0 to 24,79 double
- activate window wError
- *-- sample message inspired by movie China Syndrome
- x=surround(4,"rg+/rg"," ** E R R O R L O G ** ")
- do center with 8,80,"",;
- "The following unscheduled event has happened."
- do center with 10,80,""," "+trim(m->cErrTxt)+" "
- do center with 12,80,"","The information has been stored to disk."
- do center with 14,80,"","Notify Programmer Immediately!"
- do center with 16,80,"",;
- "You are being returned to the dot prompt, or"
- do center with 18,80,"","(if using RUNTIME) being dropped to DOS."
- do center with 20,80,"","Press a key to continue ..."
- *-- Wait until user sees message
- x=inkey(0)
-
- *--------------------------------------------------------------------
- *-- Network message to programmer?
- *--------------------------------------------------------------------
- if .not. isblank(m->cNetId)
- * From Bob (IVYBURT)
- * If you're on a network, option to send a message to network
- * manager notify of mentally deranged program.
-
- if network()=.t.
- !SEND &cNetId. " Help -- Program Crashed!"
- endif && network()
- endif && .not. isblank(m->cNetId)
-
- *--------------------------------------------------------------------
- *-- done with window, shut-down
- *--------------------------------------------------------------------
- deactivate window wError
- release window wError
- clear all
- release all
- clear
- Cancel && rather than returning user to where they were
-
- *-----------------------------------------------------------------------
- *-- Extra Functions called from above ...
- *-----------------------------------------------------------------------
-
- PROCEDURE Center
- *-----------------------------------------------------------------------
- *-- Programmer..: Miriam Liskin
- *-- Date........: 05/24/1991
- *-- Notes.......: Centers text on the screen with @says
- *-- Written for.: dBASE IV, 1.1
- *-- Rev. History: This and all other procedures/functions listed in this
- *-- file attributed to Miriam Liskin came from "Liskin's
- *-- Programming dBASE IV Book". Very good, worth the money
- *-- Calls.......: None
- *-- Called by...: Any
- *-- Usage.......: do center with <nLine>,<nWidth>,"<cColor>","<cText>"
- *-- Example.....: do center with 5,65,"RG+/GB",;
- *-- "WARNING! This will blow up!"
- *-- Note that the color field may be blank: ""
- *-- Returns.....: None
- *-- Parameters..: nLine = Line or Row for @/Say
- *-- nWidth = Width of screen
- *-- cColor = Colors to be used ("Forg/Back")
- *-- (may be nul "", in order to use the default
- *-- colors of window/screen)
- *-- cText = Message to center on screen
- *-----------------------------------------------------------------------
-
- parameters nLine,nWidth,cColor,cText
- private nCol
-
- m->nCol = (m->nWidth - len(m->cText)) /2
- @m->nLine,m->nCol say cText color &cColor.
-
- RETURN
- *-- EoP: Center
-
- FUNCTION Surround
- *-----------------------------------------------------------------------
- *-- Programmer..: Kenneth J. Mayer (CIS: 71333,1030)
- *-- Date........: 06/28/1993
- *-- Notes.......: Displays a message surrounded by a box anywhere on
- *-- the screen -- this version centers automatically on
- *-- the screen and gives a 3-D border ...
- *-- This is based on the original routine by Miriam Liskin
- *-- Written for.: dBASE IV, 1.5
- *-- Rev. History: 06/09/1993 -- Original
- *-- 06/28/1993 -- Fixed minor problem -- if displaying
- *-- over a textured background, the borders
- *-- can look a bit odd. Added a CLEAR ...
- *-- Calls.......: SHADOW Procedure in PROC.PRG
- *-- Bord3D Procedure in PROC.PRG
- *-- Called by...: Any
- *-- Usage.......: Surround(<nLine>,"<cColor>","<cText>"[,<nStyle>])
- *-- Example.....: cDummy = Surround(5,12,"RG+/GB",;
- *-- "Processing ... Do not Touch!",1)
- *-- Returns.....: Nul/""
- *-- Parameters..: nLine = Line to display "surrounded" message at
- *-- if nLine = 0, we will center on the screen
- *-- vertically, as well as horizontally.
- *-- cColor = Color variable/colors (Default to grey)
- *-- cText = Text to be displayed inside box
- *-- nStyle = Style of border 1 = Double - Raised(Default)
- *-- 2 = Double - Recessed
- *-- 3 = Single - Raised
- *-- 4 = Double - Recessed
- *-- NOTE: This is OPTIONAL
- *-----------------------------------------------------------------------
-
- parameters nLine,cColor,cText,nStyle
- private nStyle, cColor, cText2, nTextStart, nTop, nLeft, nBottom,;
- nRight, nLine
-
- *-- deal with defaults
- if pCount() < 4 .or. (m->nStyle < 1 .or. m->nStyle > 4)
- m->nStyle = 1
- endif
- if isblank(m->cColor)
- m->cColor = "n/w"
- endif
-
- *-- deal with nLine being equal to 0 when user passes this (this will
- *-- cause the routine to center on the screen ... no matter how the
- *-- screen is set).
- if m->nLine = 0
- m->cScreen = set("DISPLAY")
- if m->cScreen = "MONO"
- m->nScreen = 24
- else
- m->nScreen = val(right(m->cScreen,2)) - 1 && EGA25 = 0 to 24
- endif
- m->nLine = int(m->nScreen/2) && halfway ...
- endif
-
- m->cText2 = " "+trim(m->cText)+" " && add spaces to left and right
- m->nTextStart = (81-len(trim(m->cText2)))/2 && centered text
- activate screen
- m->nTop = m->nLine - iif(m->nStyle < 3,2,1) && up 2 or 1 ...
- m->nLeft = m->nTextStart - iif(m->nStyle < 3,3,2) && back up 3
- m->nBottom = m->nLine + iif(m->nStyle < 3,2,1) && bottom row
- m->nRight = (81-m->nTextStart) + iif(m->nStyle < 3,3,2) && right
-
- *-- draw shadow
- do shadow with m->nTop,m->nLeft,m->nBottom,m->nRight
-
- *-- fill in box
- @m->nTop,m->nLeft clear to m->nBottom,m->nRight
- @m->nTop,m->nLeft fill to m->nBottom,m->nRight color &cColor.
-
- *-- place border on top of it
- do Bord3D with m->nTop,m->nLeft,m->nBottom,m->nRight,m->cColor,;
- m->nStyle
-
- *-- finally, let's display the text ...
- @m->nLine, m->nTextStart say m->cText2 color &cColor.
-
- RETURN ""
- *-- EoF: Surround()
-
- PROCEDURE Bord3D
- *-----------------------------------------------------------------------
- *-- Programmer..: Kenneth J. Mayer (CIS: 71333,1030)
- *-- Date........: 06/02/1993
- *-- Notes.......: This is an attempt to combine the 3-D border routines
- *-- (BORD3D through BORD3D4) -- allowing a selection
- *-- between four border styles ...
- *-- Written for.: dBASE IV, 1.5 or later
- *-- Rev. History: 06/02/1993
- *-- Calls.......: None
- *-- Called by...: Any
- *-- Usage.......: do Bord3D with <nULR>,<nULC>,<nBRR>,<nBRC>,<cColor>,;
- *-- <nStyle>
- *-- Example.....: do Bord3D with 0,0,15,60,2
- *-- Returns.....: None
- *-- Parameters..: nULR = Upper Left Row (Starting Coordinates)
- *-- nULC = Upper Left Column
- *-- nBRR = Bottom Right Row (Ending Coordinates)
- *-- nBRC = Bottom Right Column
- *-- cColor = Colors of Window/Box ...
- *-- nStyle = Border style:
- *-- 1 = Double, Raised
- *-- 2 = Double, Recessed
- *-- 3 = Single, Raised
- *-- 4 = Single, Recessed
- *-----------------------------------------------------------------------
-
- parameters nULR, nULC, nBRR, nBRC, cColor, nStyle
- private cBorder,cBackColor,cHighColor,cShadColor
-
- *-- deal with border ...
- m->cBorder = set("BORDER")
- set border to single
-
- *-- figure out colors
- m->cBackColor = backcolor(m->cColor)
- m->cHighColor = "W+/"+m->cBackColor
- m->cShadColor = "N/"+m->cBackColor
-
- if m->nStyle < 1 .or. m->nStyle > 4 && if not 1 through 4 ...
- m->nStyle = 1
- endif
-
- do case
- case m->nStyle = 1
-
- *-- Raised DOUBLE Border
- *-- Outside of "border"
- @m->nULR,m->nULC to m->nULR,m->nBRC color &cHighColor.
- @m->nULR,m->nULC to m->nBRR,m->nULC color &cHighColor.
- @m->nULR,m->nULC say chr(218) color &cHighColor.
- @m->nBRR,m->nULC say chr(192) color &cHighColor.
- @m->nULR,m->nBRC to m->nBRR,m->nBRC color &cShadColor.
- @m->nBRR,m->nULC+1 to m->nBRR,m->nBRC color &cShadColor.
- @m->nULR,m->nBRC say chr(191) color &cShadColor.
- @m->nBRR,m->nBRC say chr(217) color &cShadColor.
-
- *-- inside of "border"
- @m->nULR+1,m->nULC+2 to m->nULR+1,m->nBRC-2 color &cShadColor.
- @m->nULR+1,m->nULC+2 to m->nBRR-1,m->nULC+2 color &cShadColor.
- @m->nULR+1,m->nULC+2 say chr(218) color &cShadColor.
- @m->nBRR-1,m->nULC+2 say chr(192) color &cShadColor.
- @m->nULR+1,m->nBRC-2 to m->nBRR-1,m->nBRC-2 color &cHighColor.
- @m->nBRR-1,m->nULC+3 to m->nBRR-1,m->nBRC-2 color &cHighColor.
- @m->nULR+1,m->nBRC-2 say chr(191) color &cHighColor.
- @m->nBRR-1,m->nBRC-2 say chr(217) color &cHighColor.
-
- case m->nStyle = 2
-
- *-- Recessed DOUBLE Border
- *-- Outside of "border"
- @m->nULR,m->nULC to m->nULR,m->nBRC color &cShadColor.
- @m->nULR,m->nULC to m->nBRR,m->nULC color &cShadColor.
- @m->nULR,m->nULC say chr(218) color &cShadColor.
- @m->nBRR,m->nULC say chr(192) color &cShadColor.
- @m->nULR,m->nBRC to m->nBRR,m->nBRC color &cHighColor.
- @m->nBRR,m->nULC+1 to m->nBRR,m->nBRC color &cHighColor.
- @m->nULR,m->nBRC say chr(191) color &cHighColor.
- @m->nBRR,m->nBRC say chr(217) color &cHighColor.
-
- *-- inside of "border"
- @m->nULR+1,m->nULC+2 to m->nULR+1,m->nBRC-2 color &cHighColor.
- @m->nULR+1,m->nULC+2 to m->nBRR-1,m->nULC+2 color &cHighColor.
- @m->nULR+1,m->nULC+2 say chr(218) color &cHighColor.
- @m->nBRR-1,m->nULC+2 say chr(192) color &cHighColor.
- @m->nULR+1,m->nBRC-2 to m->nBRR-1,m->nBRC-2 color &cShadColor.
- @m->nBRR-1,m->nULC+3 to m->nBRR-1,m->nBRC-2 color &cShadColor.
- @m->nULR+1,m->nBRC-2 say chr(191) color &cShadColor.
- @m->nBRR-1,m->nBRC-2 say chr(217) color &cShadColor.
-
- case m->nStyle = 3
-
- *-- Raised SINGLE Border
- @m->nULR,m->nULC to m->nULR,m->nBRC color &cHighColor.
- @m->nULR,m->nULC to m->nBRR,m->nULC color &cHighColor.
- @m->nULR,m->nBRC to m->nBRR,m->nBRC color &cShadColor.
- @m->nBRR,m->nULC to m->nBRR,m->nBRC color &cShadColor.
- @m->nULR,m->nULC say chr(218) color &cHighColor.
- @m->nBRR,m->nULC say chr(192) color &cHighColor.
- @m->nULR,m->nBRC say chr(191) color &cShadColor.
- @m->nBRR,m->nBRC say chr(217) color &cShadColor.
-
- case m->nStyle = 4
-
- *-- Recessed SINGLE Border
- @m->nULR,m->nULC to m->nULR,m->nBRC color &cShadColor.
- @m->nULR,m->nULC to m->nBRR,m->nULC color &cShadColor.
- @m->nULR,m->nBRC to m->nBRR,m->nBRC color &cHighColor.
- @m->nBRR,m->nULC to m->nBRR,m->nBRC color &cHighColor.
- @m->nULR,m->nULC say chr(218) color &cShadColor.
- @m->nBRR,m->nULC say chr(192) color &cShadColor.
- @m->nULR,m->nBRC say chr(191) color &cHighColor.
- @m->nBRR,m->nBRC say chr(217) color &cHighColor.
-
- endcase
-
- *-- reset border
- set border to &cBorder.
-
- RETURN
- *-- EoP: Bord3D
-
- PROCEDURE Shadow
- *-----------------------------------------------------------------------
- *-- Programmer..: Ashton-Tate
- *-- Date........: 06/02/1993
- *-- Notes.......: Creates a shadow for a window (taken from the dBASE IV
- *-- picklist functions)
- *-- Written for.: dBASE IV, 1.1
- *-- Rev. History: 05/23/1991 - original procedure.
- *-- 12/14/1991 - Modified by Jim Magnant (TXAGGIE) - to
- *-- check for columns exceeding 79, and temporarily
- *-- change last col. value (so routine doesn't "blow
- *-- up").
- *-- 01/27/1992 -- Modifiedy by Ken Mayer to check for
- *-- bottom of screen, based on what Jim did above. No
- *-- further than 23.
- *-- 06/02/1993 -- Modified to handle screens larger than
- *-- 24 lines. (KJM)
- *-- Calls.......: None
- *-- Called by...: Too many to list ...
- *-- Usage.......: do shadow with <nULRow>,<nULCol>,<nBRRow>,<nBRCol>
- *-- Example.....: save screen to sMain
- *-- activate screen
- *-- define window wError from 5,15 to 15,65 double color;
- *-- rg+/r,rg+/r,rg+/r
- *-- do shadow with 5,15,15,65
- *-- activate window WError
- *-- && perform actions in window
- *-- release window WError
- *-- restore screen from sMain
- *-- release screen sMain
- *-- Returns.....: None
- *-- Parameters..: nULRow = Upper Left Row position
- *-- nULCol = Upper Left Column position (x,y)
- *-- nBRRow = Bottom Right Row position
- *-- nBRCol = Bottom Right Column position (x2,y2)
- *-----------------------------------------------------------------------
-
- parameters nULRow,nULCol,nBRRow,nBRCOL
- private nTempRow,nTempCol,nIncRow,nIncCol,cScreen,nScreen
-
- *-- if screen is larger than 24 lines (EGA43, EGA50 ...)
- m->cScreen = set("DISPLAY")
- if m->cScreen = "MONO"
- m->nScreen = 23
- else
- m->nScreen = val(right(m->cScreen,2))-2
- endif
-
- m->nTempRow = iif(m->nBRRow+1>m->nScreen,m->nScreen,m->nBRRow+1)
- m->nTempCol = iif(m->nBRCol+2>79,79,m->nBRCol+2)
- m->nIncRow = 1
- m->nIncCol = (m->nBRCol-m->nULCol) / (m->nBRRow-m->nULRow)
- do while m->nTempRow <> m->nULRow .or. m->nTempCol <> m->nULCol+2
- m->nRightCol = m->nBRCol
- m->nBRCol = iif(m->nBRCol + 2 > 79,77,m->nBRCol)
- m->nBotRow = m->nBRRow
- m->nBRRow = iif(m->nBRRow + 1 > m->nScreen,m->nScreen-1,m->nBRRow)
- @ m->nTempRow,m->nTempCol fill to m->nBRRow+1,m->nBRCol+2 ;
- color n+/n
- m->nBRCol = m->nRightCol
- m->nBRRow = m->nBotRow
- m->nTempRow = iif(m->nTempRow<>m->nULRow,m->nTempRow -m->nIncRow,;
- m->nTempRow)
- m->nTempCol = iif(m->nTempCol<>m->nULCol+2,m->nTempCol - ;
- m->nIncCol,m->nTempCol)
- m->nTempCol = iif(m->nTempCol<m->nULCol+2,m->nULCol+2,m->nTempCol)
- enddo
-
- RETURN
- *-- EoP: Shadow
-
- FUNCTION BackColor
- *-----------------------------------------------------------------------
- *-- Programmer..: Jay Parsons CIS 70160,340
- *-- Date........: 02/24/1993
- *-- Notes : Returns background part of color string.
- *-- Written for.: dBASE IV, Version 1.5.
- *-- Rev. History: 02/04/1993 -- Original Release
- *-- Calls : None
- *-- Called by...: Any
- *-- Usage.......: BackColor( <cColor> )
- *-- Example.....: ? BackColor( "N/BG" )
- *-- Parameters..: cColor - String holding color foreground and
- *-- background
- *-- Returns.....: Character, string with background portion of the
- *-- color. Returns empty string if no such portion.
- *-----------------------------------------------------------------------
-
- parameters cColor
- private m->cRet
-
- m->cRet = upper( trim( ltrim( m->cColor ) ) )
- if "/" $ m->cRet
- m->cRet = substr( m->cRet, at( "/", m->cRet ) + 1 )
- if "*" $ m->cRet
- m->cRet = stuff( m->cRet, at( "*", m->cRet ), 1, "" )
- endif
- if "+" $ m->cRet
- m->cRet = stuff( m->cRet, at( "+", m->cRet ), 1, "" )
- endif
- else
- m->cRet = ""
- endif
-
- RETURN upper( ltrim( trim( m->cRet ) ) )
- *-- EoF: BackColor()
-
- *-----------------------------------------------------------------------
- *-- End of Program: ERRLOG.PRG
- *-----------------------------------------------------------------------